﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using FoneBuddy.LinqModel;

/// <summary>
/// Summary description for SessoinWrapper
/// </summary>
public class SessionWrapper
{
	public SessionWrapper()
	{
		//
		// TODO: Add constructor logic here
		//
	}
    public static Merchant Merchant
    {
        get
        {
            if (HttpContext.Current.Session["Merchant"] != null)
                return HttpContext.Current.Session["Merchant"] as Merchant;
            else
                return null;
        }
        set
        {
            HttpContext.Current.Session["Merchant"] = value;
        }
    }
    public static List<Filter> Filters
    {
        get
        {
            if (HttpContext.Current.Session["Filters"] != null)
                return HttpContext.Current.Session["Filters"] as List<Filter>;
            else
                return null;
        }
        set
        {
            HttpContext.Current.Session["Filters"] = value;
        }
    }
    public static Int64 UserId
    {
        get
        {
            if (HttpContext.Current.Session["UserId"] != null)
                return Convert.ToInt64(HttpContext.Current.Session["UserId"]);
            else
                return 0;
        }
        set
        {
            HttpContext.Current.Session["UserId"] = value;
        }
    }
    public class Filter
    {
        public Int64 Id
        {
            get;
            set;
        }
        public string Name
        {
            get;
            set;
        }
    }
}